package com.wjp.banquet.common.enums;

public enum SortTypeEnum {

    ASC("asc", "升序"),

    DESC("desc", "降序");

    private String code;
    private String msg;

    public static String getNameByCode(String code) {
        SortTypeEnum[] enums = values();

        for(int i = 0; i < enums.length; ++i) {
            SortTypeEnum anEnum = enums[i];
            if (anEnum.getCode().equals(code)) {
                return anEnum.getMsg();
            }
        }

        return null;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    private SortTypeEnum(final String code, final String msg) {
        this.code = code;
        this.msg = msg;
    }
}
